package com.xuyiwei.mayi;

import java.text.DecimalFormat;

/**
 * Created by xuyiwei on 2019/4/15.
 */
public class JvmDemoFinalize {
    public static void main(String[] args) {
//        while (true){
            JvmDemoFinalize JvmDemo02 =new JvmDemoFinalize();
            JvmDemo02 = null;
            for(int i=0;i<7;i++){
                System.out.println(i);
                System.gc();

            }
//        }

    }
    @Override
    protected void finalize() throws Throwable {
        System.out.println("运行了finalize方法");
    }
}
